# Based on http://cr.openjdk.java.net/~dlsmith/jsr335-0.6.2/A.html

(symbols "functionalMethodName" 'pico)

(local *ObjectMethods)

(setq *ObjectMethods
  (thread "java.lang.Object"
    javaClass
    (java "getMethods")
    arrayAsList
    (memberNames "Abstract" T)
    uniq) )

(de pico~functionalMethodName (Class)
  (let (Methods (thread Class
                  (java "getMethods")
                   arrayAsList)
        AbstractMethodNames (thread Methods
                              (memberNames "Abstract")
                              uniq
                              (diff *ObjectMethods) )
        InstanceMethodNames (thread Methods
                              (memberNames "Abstract" T)
                              uniq) )
    (when (cdr AbstractMethodNames)
      (setq AbstractMethodNames
        (diff AbstractMethodNames InstanceMethodNames) ) )
    (when (thread AbstractMethodNames
            cdr
            not)
      (car AbstractMethodNames) ) ) )